package com.cm.sys.intermanager.utils;

import com.cm.sys.framework.execption.BusinessException;

/***
 * 系统调用返回实体
 * 
 * @author yxq18
 *
 */
public class HttpResult<T> {

    /***
     * 状态码
     */
    private Integer code;
    /***
     * 返回信息
     */
    private String message;
    /***
     * 返回对象
     */
    private T data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {

        if (200 == this.code) {
            this.data = data;
        } else {
            throw new BusinessException(code, message);
        }

    }

}
